<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="-1" />
	<title>REDEUZE</title>
	<link href="imagem/favicon.png" type="image/png" rel="shortcut icon" />


	<script type="text/javascript">  
    function handleLoginRequest(xhr, status, args) {  
        if(args.validationFailed || !args.loggedIn) {  
            dlg.jq.effect("shake", { times:5 }, 100);  
        }   
        else {  
            dlg.hide();  
            $('#loginLink').fadeOut();  
        }  
        
    }  
</script>
</h:head>

<h:body
	style="
			background-image: url(imagens/wallpaper.jpg);
			background-repeat: no-repeat;
	    	background_attachment: fixed;
			image-rendering: auto;
	">
	<div
		style="position: absolute; left: 50%; margin-left: -408px; top: 30%; margin-top: -150px">
		<p:graphicImage url="/imagens/logo_skytef.png"></p:graphicImage>
	</div>


	<h:form id="form">

		<div
			style="position: absolute; text-align: center; left: 50%; margin-left: -193px; top: 50%">
			<p:panel header="Login de Acesso ao Sistema">
			<p:growl id="msgs" showDetail="true" />
				<h:outputLabel  value="Mensagem: Usuário ou senha inválidos" style="color:red" />
				<h:panelGrid columns="2" cellpadding="5">
					<h:outputLabel for="username" value="Usuário:*" />
					<p:inputText value="#{LoginBean.username}" id="username" required="true" requiredMessage="Campo usuário obrigatório"
						label="Usuário" />
					<h:outputLabel for="password" value="Senha:*" />
					<h:inputSecret value="#{LoginBean.password}" id="password"
						label="Senha" required="true" requiredMessage="Campo senha obrigatório"/>

					<f:facet name="footer">
						<p:commandButton id="LoginButton" value="Login" update="dlg"
							actionListener="#{LoginBean.login}" ajax="false"
							style="width: 100%;"
							oncomplete="handleLoginRequest(xhr, status, args)" />
					</f:facet>
				</h:panelGrid>

			</p:panel>
		</div>
	</h:form>

</h:body>
</html>